// formPackage/pages/newHousePublishModule/newHousePublishFirst/newHousePublishFirst.js
import { chooseAndUploadQiniuActicon, chooseAndUploadQiniuVideoAction, chooseMultipleImgUploadQiniuAction } from "../../../service/upload_service"
import debounce from "../../../tools/debounce"
import { createNewHouseBasicInfo, queryNewHouseBasicInfo, updateNewHouseBasicInfo } from "../../../service/publish_service"
import { queryNewHouseTags, queryNewHouseIsExit } from "../../../service/house_service"


let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    themeStyle: "",
    showSinglePop: false,//显示选择弹窗
    singlePopType: "",//单项弹窗类型
    singlePopTitle: "选择",//单项弹窗标题
    showDeliveryTimePop: false,//交付时间选择
    minDate: new Date(2000, 12, 31).getTime(),
    maxDate: new Date(2050, 12, 31).getTime(),
    timePopType: "",
    showCityArea: false,//城市区域
    formData: {
      buildMold: "",//楼型
      bedroomNumber: "",//几室
      category: "",//发布的类型,直卖或者是委托
      coverPic: "",//封面图
      decoration: "",//装修
      elevator: "",//电梯
      fgjHouseNumber: "",//房管局number
      fgjValidCode: "",//房管局code
      formats: "",//户型标题,
      homeownerName: "",
      homeownerPhone: "",
      "houseNumber": "",
      "houseUse": "",//用途
      "images": [],//所有的图片
      lookStatus: "随时看房",//看房状态
      ownership: "",//权属
      propertyYears: "",//产权年限
      area: "",
      decoration: "",//装修
      houseIntroduce: "",//房源介绍

      "totalPrice": "",
      "totalStorey": "",//总楼层
      unitPrice: "",//参考单价
      // subway: "",//地铁
      toward: "",//总朝向
      videoUrl: "",//视频地址
      storey: "",//楼层
      titleDesc: "",//描述
      tags: [

      ],
      secondTags: [

      ],
      years: "",//房源年代
      homeownerName: "",
      homeownerPhone: "",
      houseDong: "",//楼栋
      houseUnit: "",//单元
      houseFloor: "",//楼层
      houseRoomNo: "",//房号
    },
    floorShowText: "",//展示的楼层值
    communityNumber: "",//小区编号
    secondTagArr: [],//房源特色标签
    selectSecondTagArr: [],//已选中的房源特色标签
    houseMainTag: {},//房源主标签
    houseNumber: "",
    isHaveBasicInfo: false,//是否已有新房基础信息
    btnTitle: "保存",
    mainTagsArr: [

    ],
    multiType: "",
    currentMainTagsArr: [],//当前选中的主标签
    mainSelectTagIndex: 100,//主标签
    tagsType: 1,//默认请求主标签
    /**
     * type: 0 :普通标签
     *       1 :主标签
     */

    isFoldTag: false,
    isShowFloorPopup: false,
    popTitle: "",

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {



  },


  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    if (app.globalData.themeStyle) {
      this.setData({
        themeStyle: app.globalData.themeStyle
      })
    }
  },


})